home *** CD-ROM | disk | FTP | other *** search
- class MissionInfo extends MovieClip
- {
- var mcInfo;
- var mcCar;
- var oList;
- var btnEasyMoney;
- function MissionInfo()
- {
- super();
- if(Game.level == 0)
- {
- this.mcInfo.gotoAndStop(2);
- }
- else
- {
- this.mcInfo.gotoAndStop(5 + Game.level);
- }
- this.mcCar.mcWeapon.gotoAndStop(Game.getInstance().sEnemy);
- }
- function init()
- {
- if(Game.level > 0)
- {
- this.mcCar.mcWeapon.mcAnim.gotoAndPlay("show");
- }
- this.setInfo();
- this.oList = new Object();
- this.oList.onKeyDown = mx.utils.Delegate.create(this,this.onKeyDown);
- Key.addListener(this.oList);
- this.mcInfo.btnEasyMoney.onRelease = mx.utils.Delegate.create(this,this.onReleaseEasyMoney);
- trace(this.btnEasyMoney);
- Sounds.stopSound("engineIdle");
- Sounds.playSound("engineIdle",99999);
- }
- function close(Void)
- {
- Game.getInstance().initLevel();
- Game.getInstance().startWork();
- this.removeMovieClip();
- }
- function onKeyDown(Void)
- {
- if(Key.isDown(38))
- {
- if(!Application.bEasy && this.mcInfo._currentframe == 2)
- {
- Application.bEasy = true;
- this.mcInfo.mcArrows._y = 110;
- Game.getInstance().setLives();
- }
- }
- else if(Key.isDown(40))
- {
- if(Application.bEasy && this.mcInfo._currentframe == 2)
- {
- Application.bEasy = false;
- this.mcInfo.mcArrows._y = 130;
- Game.getInstance().setLives();
- }
- }
- if(Key.isDown(32))
- {
- if(this.mcInfo._currentframe < 5)
- {
- this.mcInfo.nextFrame();
- this.setInfo();
- }
- else
- {
- Key.removeListener(this.oList);
- this.mcCar.mcWeapon.mcAnim.gotoAndPlay("hide");
- §§push(this.gotoAndPlay("out"));
- }
- }
- }
- function setInfo(Void)
- {
- if(this.mcInfo.btnNext.onRelease == undefined)
- {
- this.mcInfo.btnNext.onRelease = mx.utils.Delegate.create(this,this.onReleaseNext);
- }
- if(this.mcInfo._currentframe == 2)
- {
- this.mcInfo.btnEasy.onRollOver = mx.utils.Delegate.create(this,this.onRollOverEasy);
- this.mcInfo.btnEasy.onRelease = mx.utils.Delegate.create(this,this.onReleaseEasy);
- this.mcInfo.btnHard.onRollOver = mx.utils.Delegate.create(this,this.onRollOverHard);
- this.mcInfo.btnHard.onRelease = mx.utils.Delegate.create(this,this.onReleaseHard);
- if(Application.bEasy)
- {
- this.mcInfo.mcArrows._y = 110;
- }
- else
- {
- this.mcInfo.mcArrows._y = 130;
- }
- }
- else if(this.mcInfo._currentframe >= 5)
- {
- if(this.mcInfo._currentframe == 5)
- {
- this.mcCar.mcWeapon.mcAnim.gotoAndPlay("show");
- }
- }
- }
- function onReleaseNext(Void)
- {
- trace(this.mcInfo._currentframe);
- if(this.mcInfo._currentframe < 5)
- {
- this.mcInfo.nextFrame();
- this.setInfo();
- }
- else
- {
- Key.removeListener(this.oList);
- this.mcInfo.btnNext.onRelease = null;
- this.mcCar.mcWeapon.mcAnim.gotoAndPlay("hide");
- §§push(this.gotoAndPlay("out"));
- }
- }
- function onRollOverEasy(Void)
- {
- Application.bEasy = true;
- this.mcInfo.mcArrows._y = 110;
- Game.getInstance().setLives();
- }
- function onReleaseEasy(Void)
- {
- Application.bEasy = true;
- this.mcInfo.mcArrows._y = 110;
- Game.getInstance().setLives();
- this.onReleaseNext();
- }
- function onRollOverHard(Void)
- {
- Application.bEasy = false;
- this.mcInfo.mcArrows._y = 130;
- Game.getInstance().setLives();
- }
- function onReleaseHard(Void)
- {
- Application.bEasy = false;
- this.mcInfo.mcArrows._y = 110;
- Game.getInstance().setLives();
- this.onReleaseNext();
- }
- function onReleaseEasyMoney(Void)
- {
- this.getURL("http://www.easymoney.com","_blank");
- }
- }
-